/* 定位 first-button 类的按钮并在其后添加一个分隔符 */
.first-button::after {
    display: inline-block;
    width: 1px;
    height: 16px;
    background: rgba(33, 150, 243, 0.3); /* 蓝色分隔线 */
    margin: 0 0.8rem;
}

/* 分类容器 */
.category-container {
    /* background: #ffffff; */
    padding: 1.8rem 2.5rem;
    /* border-radius: 16px; */
    /* box-shadow: 
        0 4px 6px rgba(33, 150, 243, 0.08),  /* 蓝色调阴影 */
        /* 0 1px 2px rgba(33, 150, 243, 0.06); */ 
    margin: 1.5rem auto;
    width: 92%;
    max-width: 1200px;
    /* border: 1px solid rgba(33, 150, 243, 0.15);  */
    position: relative;
    overflow: hidden;
}

/* 玻璃质感背景效果（可选） */
.category-container::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    z-index: -1;
}

/* 分类标题 */
.category-title {
    font-weight: 600;
    color: #0b0d0f; 
    font-size: 0.95rem;
    margin-right: 1rem;
    position: relative;
    display: flex;
    align-items: center;
    white-space: nowrap; /* 防止折行 */
}

/* 分类选项按钮 */
.category-option, 
.sort-option,
#toggleSortOrder {
    cursor: pointer;
    background: none;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #020303; 
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    margin-right: 0.5rem;
}

.category-option:hover, 
.sort-option:hover,
#toggleSortOrder:hover,
.first-button:hover {
    text-decoration: underline;
    color: #363b3b;
}

/* 激活状态 */
.category-option.active, 
.sort-option.active {
    font-weight: 600;
   color: #4ea7e6;
}

/* 激活状态指示器 */
.category-option.active::after, 
.sort-option.active::after {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40%;
    height: 2px;
    text-shadow: 0 4px 8px rgba(2, 2, 2, 0.4); /* 黑色色阴影 */
    border-radius: 2px;
}

/* 排序方向按钮 */
#toggleSortOrder {
    color: rgb(16, 12, 12);
    font-weight: 500;
    transition: all 0.25s ease;
}

#toggleSortOrder:hover {
    transform: translateY(-1px);
    text-shadow: 0 4px 8px rgba(2, 2, 2, 0.4);
}

/* 搜索结果标题样式 */
.search-title {
    /* background:  #2196F3; */
    color: black;
    /* padding: 25px 40px; */
    margin: 0;
    text-align: center;
    /* border-bottom: 3px solid rgba(255, 255, 255, 0.2); */
}
.search-title p{
font-weight: 600;
 font-size: 30;
}
.search-title h2 {
    margin: 0 0 8px 0;
    font-size: 1.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #020303;
    text-align: center;
}

.search-title h2 i {
    font-size: 1.5rem;
    opacity: 0.9;
}

.search-title .search-info {
    margin: 0;
    font-size: 1rem;
    opacity: 0.9;
    font-weight: 400;
}

/* 课程列表容器 */
.courses-container {
    background: #f8f9fa;
    padding: 0;
    /* border-radius: 12px; */
    /* box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08); */
    margin: 20px auto;
    width: 90%;
    max-width: 1200px;
    border: 1px solid #e9ecef;
    overflow: hidden;
}

/* 课程卡片 */
.registered {
    background: #fff;
    /* border-radius: 16px; */
    overflow: hidden;
    /* box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08); */
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;

    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    max-width: 100%; /* 防止溢出 */
}

.registered:hover {
    transform: translateY(-8px) scale(1.02);
    /* box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15); */
    /* border-color: #030508; */
}

.course-image {
    width: 100%;
    height: 220px;
    position: relative;
    overflow: hidden;
}

.course-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.registered:hover .course-image img {
    transform: scale(1.05);
}

.course-info {
    padding: 12px 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.course-info h2 {
    font-size: 20px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0 0 0 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-align: center;
}
.course-info p{
    font-weight: 600;
    text-align: center;
}
.course-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    font-size: 13px;
    color: #868e96;
    justify-content: space-between; /* 子项均匀分布 */
}

.course-meta .meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.course-meta .meta-item i {
    font-size: 12px;
}

/* 空状态样式 */
.message {
    height: 200px;
    width: 200px;
    text-align: center;
    display: flex;
    flex-direction: column;
    margin: 20px auto;
    position: relative;
    background: #fff;
    border-radius: 12px;
}

.empty-state {
    grid-column: 1 / -1;
    justify-self: center;
    align-self: center;
    width: 100%;
    max-width: 400px;
    padding: 40px;
    text-align: center;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e9ecef;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.message p {
    margin: 10px 0 0 0;
    color: #666;
    font-size: 16px;
}

.message img {
    width: 80px;
    height: 80px;
    margin-bottom: 10px;
}

/* Grid布局 */
.tabs-content {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 每行固定3列 */
    gap: 24px;
    padding: 30px;
    background: transparent;
    min-height: 400px;
}


/* 响应式设计 */
@media (max-width: 768px) {
    .tabs-content {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 20px 16px;
    }
    
    .registered {
        border-radius: 12px;
        max-width: 100%; /* 防止溢出 */
    }
    
    .course-image {
        height: 180px;
    }
    
    .course-info {
        padding: 20px;
    }
    
    .course-info h2 {
        font-size: 18px;
    }
    
    .course-meta {
        gap: 12px;
        flex-wrap: wrap;
    }
    
    .course-meta .meta-item {
        font-size: 12px;
    }
    
    .message {
        width: 90%;
        height: auto;
        padding: 24px;
        margin: 16px auto;
    }
    
    .empty-state {
        margin: 20px auto;
        padding: 30px 20px;
        max-width: 90%;
    }
    
    .message img {
        width: 60px;
        height: 60px;
    }
    
    .message p {
        font-size: 14px;
    }

    .search-title {
        padding: 20px 20px;
        margin: 15px 0;
    }

    .search-title h2 {
        font-size: 1.4rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .search-title .search-info {
        font-size: 0.9rem;
    }



    .category-container {
        padding: 1.2rem;
        border-radius: 12px;
    }
  
    .category-option, 
    .sort-option,
    #toggleSortOrder {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
        margin-bottom: 0.5rem;
    }
  
    .category-title {
        width: 100%;
        margin-bottom: 0.8rem;
    }
  
    .first-button::after {
        display: none;
    }
}

@media (max-width: 480px) {
    .tabs-content {
        padding: 16px 12px;
    }
    
    .course-info {
        padding: 16px;
    }
    
    .course-info h2 {
        font-size: 16px;
    }
    
    .course-meta {
        gap: 8px;
    }
    
    .course-meta .meta-item {
        font-size: 11px;
    }
    
    .empty-state {
        padding: 20px 16px;
        margin: 16px auto;
    }
}

/* 动画效果 */
.course-list {
    opacity: 0;
    animation: fadeIn 0.5s ease-in-out forwards;
    transition: opacity 0.3s ease;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

.registered {
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 骨架屏加载效果 */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}
